package com.lee.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lee.dao.UserInfoDao;
import com.lee.entity.UserInfo;
import com.lee.service.UserInfoService;

@Service
public class UserInfoServiceImpl implements UserInfoService {

	@Autowired
	private UserInfoDao userinfodao;
		
	
	@Override
	public UserInfo findUserInfo(String tel) {
		return userinfodao.findUserInfo(tel);
	}

	@Override
	public boolean validateUserInfo(String tel) {
		boolean flags=false;
		try {
			userinfodao.validateUserInfo(tel);
			flags=true;
		} catch (Exception e) {
			e.printStackTrace();
		}		
		return flags;
	}

	@Override
	public boolean addUserInfo(UserInfo userinfo) {
		boolean flags=false;
		try {
			userinfodao.addUserInfo(userinfo);
			flags=true;
		} catch (Exception e) {
			e.printStackTrace();
		}		
		return flags;
	}

	@Override
	public boolean updatePassword(UserInfo userinfo) {
		boolean flags=false;
		try {
			userinfodao.updatePassword(userinfo);
			flags=true;
		} catch (Exception e) {
			e.printStackTrace();
		}		
		return flags;
	}

	

}
